package com.ztgf.order.mapper;

import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.order.models.bo.OrderShopStatisticsBO;
import com.ztgf.order.models.bo.OrderStatisticsBO;
import com.ztgf.order.models.vo.OrderShopTimeVO;
import com.ztgf.order.models.vo.OrderVariousItemsVO;
import com.ztgf.order.models.vo.OrderVariousShopItemsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-07-21 14:40
 * Description: 订单统计映射
 */
@Mapper
public interface OrderStatisticsMapper {

    /**
     * description: 后台管理系统订单统计今日订单总量
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-07-21
     * return: java.lang.Integer
     */
    Integer queryOrderStatisticsToDay(@Param("item") OrderStatisticsBO bo);

    /**
     * description: 查询所有最终级类目
     * param: []
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.util.List<com.ztgf.order.models.vo.OrderVariousItemsVO>
     */
    List<OrderVariousItemsVO> queryAllFianlCategory(Page<OrderVariousItemsVO> page);

    /**
     * description: 各类目整体订单统计
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.lang.Integer
     */
    Integer queryOrderVariousItems(@Param("categoryId") Long categoryId, @Param("item") OrderStatisticsBO bo);

    /**
     * description: 查询店铺类目
     * param: [page]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.util.List<com.ztgf.order.models.vo.OrderVariousShopItemsVO>
     */
    List<OrderVariousShopItemsVO> queryShopCategory(@Param("item") OrderShopStatisticsBO bo);

    /**
     * description: 各类目店铺订单统计
     * param: [shopId, categoryId, bo]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.lang.Integer
     */
    Integer queryOrderVariousShopItems(@Param("shopId") Long shopId, @Param("categoryId") Long categoryId, @Param("item") OrderShopStatisticsBO bo);

    /**
     * description: 卖家个人中心店铺信息订单量统计
     * param: [shopId, type(1今日，2昨日)]
     * author: chenyu.wang
     * date: 2020-07-31
     * return: java.lang.Integer
     */
    Integer queryStoreOrders(@Param("shopId") Long shopId, @Param("startTime") String startTime,@Param("endTime") String endTime);

    /**
     * description: 查询店铺订单今日销售额
     * param: [shopId, type]
     * author: chenyu.wang
     * date: 2020-08-01
     * return: java.math.BigDecimal
     */
    BigDecimal queryShopOrderSalesToDay(@Param("shopId") Long shopId, @Param("type") Integer type);

    /**
     * description: 卖家个人中心店铺浏览量统计
     * param: [shopId, type]
     * author: chenyu.wang
     * date: 2020-08-01
     * return: java.lang.Integer
     */
    List<OrderShopTimeVO> queryShopViews(@Param("shopId") Long shopId, @Param("type") Integer type);

    /**
     * @Description: 新的各类目订单统计，有订单的类目才显示
     * @Author: chenyu.wang
     * @Params: [page, bo]
     * @Date: 2020.12.27 22:11
     */
    List<OrderVariousItemsVO> queryNewCategoryOrderCount(Page<OrderVariousItemsVO> page, @Param("item") OrderStatisticsBO bo);
}
